home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / dll_grph / vx3d01 / 3dframes.frm < prev    next >
Text File  |  1995-11-25  |  14KB  |  484 lines

  1. VERSION 4.00
  2. Begin VB.Form frm3DFrames 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VBMax 3D Effects Demo - Frames"
  5.    ClientHeight    =   5250
  6.    ClientLeft      =   3315
  7.    ClientTop       =   3615
  8.    ClientWidth     =   7275
  9.    Height          =   5655
  10.    Icon            =   "3DFrames.frx":0000
  11.    Left            =   3255
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5250
  17.    ScaleWidth      =   7275
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   3270
  20.    Width           =   7395
  21.    Begin VB.CommandButton cmdClose 
  22.       Cancel          =   -1  'True
  23.       Caption         =   "Close"
  24.       Height          =   495
  25.       Left            =   5520
  26.       TabIndex        =   28
  27.       Top             =   4380
  28.       Width           =   1215
  29.    End
  30.    Begin VB.PictureBox picFrameAlign 
  31.       BorderStyle     =   0  'None
  32.       Height          =   1035
  33.       Left            =   1860
  34.       ScaleHeight     =   1035
  35.       ScaleWidth      =   2835
  36.       TabIndex        =   35
  37.       Top             =   4080
  38.       Width           =   2835
  39.       Begin VB.OptionButton optAlign 
  40.          Caption         =   "Center"
  41.          Height          =   255
  42.          Index           =   2
  43.          Left            =   120
  44.          TabIndex        =   18
  45.          Top             =   720
  46.          Width           =   855
  47.       End
  48.       Begin VB.OptionButton optAlign 
  49.          Caption         =   "Right Justify"
  50.          Height          =   255
  51.          Index           =   1
  52.          Left            =   120
  53.          TabIndex        =   17
  54.          Top             =   420
  55.          Width           =   1275
  56.       End
  57.       Begin VB.OptionButton optAlign 
  58.          Caption         =   "Left Justify"
  59.          Height          =   255
  60.          Index           =   0
  61.          Left            =   120
  62.          TabIndex        =   16
  63.          Top             =   120
  64.          Value           =   -1  'True
  65.          Width           =   1095
  66.       End
  67.    End
  68.    Begin VB.PictureBox picFrameShadow 
  69.       BorderStyle     =   0  'None
  70.       Height          =   1035
  71.       Left            =   180
  72.       ScaleHeight     =   1035
  73.       ScaleWidth      =   1395
  74.       TabIndex        =   34
  75.       Top             =   4080
  76.       Width           =   1395
  77.       Begin VB.OptionButton optShadow 
  78.          Caption         =   "Light"
  79.          Height          =   255
  80.          Index           =   0
  81.          Left            =   60
  82.          TabIndex        =   8
  83.          Top             =   120
  84.          Value           =   -1  'True
  85.          Width           =   795
  86.       End
  87.       Begin VB.OptionButton optShadow 
  88.          Caption         =   "Dark"
  89.          Height          =   255
  90.          Index           =   1
  91.          Left            =   60
  92.          TabIndex        =   9
  93.          Top             =   480
  94.          Width           =   795
  95.       End
  96.    End
  97.    Begin VB.PictureBox picFrameStyle 
  98.       BorderStyle     =   0  'None
  99.       Height          =   2895
  100.       Left            =   4980
  101.       ScaleHeight     =   2895
  102.       ScaleWidth      =   2115
  103.       TabIndex        =   33
  104.       Top             =   540
  105.       Width           =   2115
  106.       Begin VB.OptionButton optEffect 
  107.          Caption         =   "Normal"
  108.          Height          =   255
  109.          Index           =   0
  110.          Left            =   120
  111.          TabIndex        =   19
  112.          Top             =   120
  113.          Value           =   -1  'True
  114.          Width           =   915
  115.       End
  116.       Begin VB.OptionButton optEffect 
  117.          Caption         =   "Raised"
  118.          Height          =   255
  119.          Index           =   1
  120.          Left            =   120
  121.          TabIndex        =   20
  122.          Top             =   420
  123.          Width           =   915
  124.       End
  125.       Begin VB.OptionButton optEffect 
  126.          Caption         =   "Recessed"
  127.          Height          =   255
  128.          Index           =   2
  129.          Left            =   120
  130.          TabIndex        =   21
  131.          Top             =   720
  132.          Width           =   1155
  133.       End
  134.       Begin VB.OptionButton optEffect 
  135.          Caption         =   "Embossed Raised"
  136.          Height          =   255
  137.          Index           =   3
  138.          Left            =   120
  139.          TabIndex        =   22
  140.          Top             =   1020
  141.          Width           =   1695
  142.       End
  143.       Begin VB.OptionButton optEffect 
  144.          Caption         =   "Embossed Recessed"
  145.          Height          =   255
  146.          Index           =   4
  147.          Left            =   120
  148.          TabIndex        =   23
  149.          Top             =   1320
  150.          Width           =   1995
  151.       End
  152.       Begin VB.OptionButton optEffect 
  153.          Caption         =   "Floating"
  154.          Height          =   255
  155.          Index           =   5
  156.          Left            =   120
  157.          TabIndex        =   24
  158.          Top             =   1620
  159.          Width           =   915
  160.       End
  161.       Begin VB.OptionButton optEffect 
  162.          Caption         =   "Outline Right"
  163.          Height          =   255
  164.          Index           =   6
  165.          Left            =   120
  166.          TabIndex        =   25
  167.          Top             =   1920
  168.          Width           =   1335
  169.       End
  170.       Begin VB.OptionButton optEffect 
  171.          Caption         =   "Outline Left"
  172.          Height          =   255
  173.          Index           =   7
  174.          Left            =   120
  175.          TabIndex        =   26
  176.          Top             =   2220
  177.          Width           =   1275
  178.       End
  179.       Begin VB.OptionButton optEffect 
  180.          Caption         =   "Projected"
  181.          Height          =   255
  182.          Index           =   8
  183.          Left            =   120
  184.          TabIndex        =   27
  185.          Top             =   2520
  186.          Width           =   1155
  187.       End
  188.    End
  189.    Begin VB.PictureBox picFrameFont 
  190.       BorderStyle     =   0  'None
  191.       Height          =   2895
  192.       Left            =   1860
  193.       ScaleHeight     =   2895
  194.       ScaleWidth      =   2835
  195.       TabIndex        =   30
  196.       Top             =   540
  197.       Width           =   2835
  198.       Begin VB.CheckBox chkStrikeout 
  199.          Caption         =   "Strikeout"
  200.          Height          =   315
  201.          Left            =   1320
  202.          TabIndex        =   15
  203.          Top             =   2520
  204.          Width           =   1095
  205.       End
  206.       Begin VB.CheckBox chkUnderline 
  207.          Caption         =   "Underline"
  208.          Height          =   315
  209.          Left            =   1320
  210.          TabIndex        =   14
  211.          Top             =   2160
  212.          Width           =   1095
  213.       End
  214.       Begin VB.CheckBox chkItalic 
  215.          Caption         =   "Italic"
  216.          Height          =   315
  217.          Left            =   1320
  218.          TabIndex        =   13
  219.          Top             =   1800
  220.          Width           =   795
  221.       End
  222.       Begin VB.CheckBox chkBold 
  223.          Caption         =   "Bold"
  224.          Height          =   315
  225.          Left            =   1320
  226.          TabIndex        =   12
  227.          Top             =   1440
  228.          Width           =   795
  229.       End
  230.       Begin VB.ComboBox cboTextSize 
  231.          Height          =   1740
  232.          Left            =   120
  233.          Style           =   1  'Simple Combo
  234.          TabIndex        =   11
  235.          Top             =   1080
  236.          Width           =   915
  237.       End
  238.       Begin VB.ComboBox cboFontNames 
  239.          Height          =   315
  240.          Left            =   120
  241.          Sorted          =   -1  'True
  242.          Style           =   2  'Dropdown List
  243.          TabIndex        =   10
  244.          Top             =   360
  245.          Width           =   2535
  246.       End
  247.       Begin VB.Label Label3 
  248.          AutoSize        =   -1  'True
  249.          Caption         =   "Size:"
  250.          Height          =   195
  251.          Left            =   120
  252.          TabIndex        =   32
  253.          Top             =   840
  254.          Width           =   345
  255.       End
  256.       Begin VB.Label Label2 
  257.          AutoSize        =   -1  'True
  258.          Caption         =   "Name:"
  259.          Height          =   195
  260.          Left            =   120
  261.          TabIndex        =   31
  262.          Top             =   120
  263.          Width           =   465
  264.       End
  265.    End
  266.    Begin VB.PictureBox picFrameColor 
  267.       BorderStyle     =   0  'None
  268.       Height          =   2895
  269.       Left            =   180
  270.       ScaleHeight     =   2895
  271.       ScaleWidth      =   1395
  272.       TabIndex        =   29
  273.       Top             =   540
  274.       Width           =   1395
  275.       Begin VB.OptionButton optColor 
  276.          Caption         =   "Black"
  277.          ForeColor       =   &H00000000&
  278.          Height          =   255
  279.          Index           =   1
  280.          Left            =   120
  281.          TabIndex        =   0
  282.          Top             =   180
  283.          Value           =   -1  'True
  284.          Width           =   1095
  285.       End
  286.       Begin VB.OptionButton optColor 
  287.          Caption         =   "Red"
  288.          ForeColor       =   &H000000FF&
  289.          Height          =   255
  290.          Index           =   2
  291.          Left            =   120
  292.          TabIndex        =   1
  293.          Top             =   480
  294.          Width           =   1095
  295.       End
  296.       Begin VB.OptionButton optColor 
  297.          Caption         =   "Green"
  298.          ForeColor       =   &H0000FF00&
  299.          Height          =   255
  300.          Index           =   3
  301.          Left            =   120
  302.          TabIndex        =   2
  303.          Top             =   780
  304.          Width           =   1095
  305.       End
  306.       Begin VB.OptionButton optColor 
  307.          Caption         =   "Yellow"
  308.          ForeColor       =   &H0000FFFF&
  309.          Height          =   255
  310.          Index           =   4
  311.          Left            =   120
  312.          TabIndex        =   3
  313.          Top             =   1080
  314.          Width           =   1095
  315.       End
  316.       Begin VB.OptionButton optColor 
  317.          Caption         =   "Blue"
  318.          ForeColor       =   &H00FF0000&
  319.          Height          =   255
  320.          Index           =   5
  321.          Left            =   120
  322.          TabIndex        =   4
  323.          Top             =   1380
  324.          Width           =   1095
  325.       End
  326.       Begin VB.OptionButton optColor 
  327.          Caption         =   "Magenta"
  328.          ForeColor       =   &H00FF00FF&
  329.          Height          =   255
  330.          Index           =   6
  331.          Left            =   120
  332.          TabIndex        =   5
  333.          Top             =   1680
  334.          Width           =   1095
  335.       End
  336.       Begin VB.OptionButton optColor 
  337.          Caption         =   "Cyan"
  338.          ForeColor       =   &H00FFFF00&
  339.          Height          =   255
  340.          Index           =   7
  341.          Left            =   120
  342.          TabIndex        =   6
  343.          Top             =   1980
  344.          Width           =   1095
  345.       End
  346.       Begin VB.OptionButton optColor 
  347.          Caption         =   "White"
  348.          ForeColor       =   &H00FFFFFF&
  349.          Height          =   255
  350.          Index           =   8
  351.          Left            =   120
  352.          TabIndex        =   7
  353.          Top             =   2280
  354.          Width           =   1095
  355.       End
  356.    End
  357. End
  358. Attribute VB_Name = "frm3DFrames"
  359. Attribute VB_Creatable = False
  360. Attribute VB_Exposed = False
  361. Option Explicit
  362. Dim mo3D As New cls3D
  363.  
  364. Private Sub cmdClose_Click()
  365.     Unload Me
  366. End Sub
  367.  
  368. Private Sub Form_Load()
  369. Dim i As Integer
  370.     
  371.     Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  372.         
  373.     For i = 0 To Screen.FontCount - 1
  374.         cboFontNames.AddItem Screen.Fonts(i)
  375.     Next i
  376.  
  377.     With cboTextSize
  378.         .AddItem "8"
  379.         .AddItem "10"
  380.         .AddItem "12"
  381.         .AddItem "14"
  382.         .AddItem "20"
  383.         .AddItem "24"
  384.         .AddItem "26"
  385.         .AddItem "32"
  386.     End With
  387.     
  388.     mo3D.Style = gnNORMAL
  389.     RedrawFrames
  390.  
  391. End Sub
  392.  
  393. Private Sub Form_Unload(Cancel As Integer)
  394.     Set mo3D = Nothing
  395.     Set frm3DFrames = Nothing
  396. End Sub
  397.  
  398. Sub RedrawFrames()
  399.     Cls
  400.     With mo3D
  401.         .Frame picFrameColor, "Color"
  402.         .Frame picFrameAlign, "Alignment"
  403.         .Frame picFrameFont, "Font"
  404.         .Frame picFrameShadow, "Shadow"
  405.         .Frame picFrameStyle, "Effect"
  406.     End With
  407. End Sub
  408.  
  409. Private Sub optColor_Click(Index As Integer)
  410.     mo3D.ForeColor = optColor(Index).ForeColor
  411.     RedrawFrames
  412. End Sub
  413.  
  414. Private Sub cboFontNames_Click()
  415.     mo3D.FontName = cboFontNames.Text
  416.     RedrawFrames
  417. End Sub
  418.  
  419. Private Sub cboTextSize_Click()
  420.     cboTextSize_Change
  421. End Sub
  422.  
  423. Private Sub cboTextSize_Change()
  424.     mo3D.FontSize = Val(cboTextSize.Text)
  425.     RedrawFrames
  426. End Sub
  427.  
  428. Private Sub chkBold_Click()
  429.     If chkBold.Value = vbChecked Then
  430.         mo3D.FontBold = True
  431.     Else
  432.         mo3D.FontBold = False
  433.     End If
  434.     RedrawFrames
  435. End Sub
  436.  
  437. Private Sub chkItalic_Click()
  438.     If chkItalic.Value = vbChecked Then
  439.          mo3D.FontItalic = True
  440.     Else
  441.          mo3D.FontItalic = False
  442.     End If
  443.     RedrawFrames
  444. End Sub
  445.  
  446.  
  447. Private Sub chkStrikeout_Click()
  448.     If chkStrikeout.Value = vbChecked Then
  449.         mo3D.FontStrikethru = True
  450.     Else
  451.         mo3D.FontStrikethru = False
  452.     End If
  453.     RedrawFrames
  454. End Sub
  455.  
  456. Private Sub optEffect_Click(Index As Integer)
  457.     mo3D.Style = Index
  458.     RedrawFrames
  459. End Sub
  460.  
  461. Private Sub optShadow_Click(Index As Integer)
  462.     Select Case Index
  463.         Case 0: mo3D.Shadow = gnLIGHT_SHADOW
  464.         Case 1: mo3D.Shadow = gnDARK_SHADOW
  465.     End Select
  466.     RedrawFrames
  467. End Sub
  468.  
  469. Private Sub optAlign_Click(Index As Integer)
  470.     mo3D.Alignment = Index
  471.     RedrawFrames
  472. End Sub
  473.  
  474.  
  475. Private Sub chkUnderline_Click()
  476.     If chkUnderline.Value = vbChecked Then
  477.         mo3D.FontUnderline = True
  478.     Else
  479.         mo3D.FontUnderline = False
  480.     End If
  481.     RedrawFrames
  482. End Sub
  483.  
  484.